
import { IsString, IsNumber, IsBoolean, IsDate, IsOptional, IsEnum } from 'class-validator';
import { ApiProperty, OmitType, IntersectionType } from '@nestjs/swagger';
import { PagingDto } from 'src/common/dto/index';
import { CharEnum } from 'src/common/enum/index';


export class BaseStudentDto{
	@ApiProperty({required: false , description: '学生ID'})
	@IsOptional()
	@IsNumber()
	studentId?: number;

	@ApiProperty({enum: CharEnum, required: false , description: '删除标志'})
	@IsOptional()
	@IsString()
	delFlag?: string;

	@ApiProperty({enum: CharEnum, required: false , description: '状态'})
	@IsOptional()
	@IsString()
	status?: string;

	@ApiProperty({required: false , description: '创建者'})
	@IsOptional()
	@IsString()
	createBy?: string;

	@ApiProperty({required: false , description: '创建时间'})
	@IsOptional()
	@IsString()
	createTime?: string;

	@ApiProperty({required: false , description: '更新者'})
	@IsOptional()
	@IsString()
	updateBy?: string;

	@ApiProperty({required: false , description: '更新时间'})
	@IsOptional()
	@IsString()
	updateTime?: string;

	@ApiProperty({required: false , description: '备注'})
	@IsOptional()
	@IsString()
	remark?: string;

	@ApiProperty({required: false , description: '学号'})
	@IsOptional()
	@IsString()
	studentNumber?: string;

	@ApiProperty({required: false , description: '学校编码'})
	@IsOptional()
	@IsString()
	oldName?: string;

	@ApiProperty({required: false , description: '学校编码'})
	@IsOptional()
	@IsString()
	idCard?: string;

	@ApiProperty({required: false , description: '联系电话'})
	@IsOptional()
	@IsString()
	phone?: string;

	@ApiProperty({required: false , description: '归属学校'})
	@IsOptional()
	@IsNumber()
	schoolId?: number;

	@ApiProperty({required: false , description: '归属校区'})
	@IsOptional()
	campusId?: number;

	@ApiProperty({required: false , description: '班级ID'})
	@IsOptional()
	classId?: number;

	@ApiProperty({required: false , description: '归属专业'})
	@IsOptional()
	proId?: number;

	@ApiProperty({required: false , description: '出生年月'})
	@IsOptional()
	@IsString()
	birthday?: string;

	@ApiProperty({required: false , description: '户籍地址'})
	@IsOptional()
	@IsString()
	cardAddress?: string;

	@ApiProperty({required: false , description: '户籍地址'})
	@IsOptional()
	@IsString()
	houseAddress?: string;

	@ApiProperty({required: false , description: '紧急联系人'})
	@IsOptional()
	@IsString()
	emergency?: string;

	@ApiProperty({required: false , description: '学生状态'})
	@IsOptional()
	@IsString()
	state?: string;

	@ApiProperty({enum: CharEnum, required: false , description: '性别'})
	@IsOptional()
	@IsString()
	gender?: string;

	@ApiProperty({required: false , description: '学校编码'})
	@IsOptional()
	@IsString()
	studentName?: string;

}

export class CreateStudentDto extends OmitType(BaseStudentDto, [ 'studentId', 'delFlag', 'createBy', 'createTime']){}

export class UpdateStudentDto extends OmitType(BaseStudentDto, [ 'delFlag', 'createBy', 'createTime']){}

export class QueryStudentDto extends IntersectionType( BaseStudentDto, PagingDto){}

export class ListStudentDto  extends OmitType(BaseStudentDto, [ 'delFlag', 'createBy', 'createTime', 'updateBy', 'updateTime']) {}
